package com.imut.lagain.service;
import org.slf4j.LoggerFactory;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.util.Map;

public interface IWeChatService {
    Map<String, String> getSessionInfo(String code);

    Map<String, Object> decryptPhoneNumber(String encryptedData, String iv, String sessionKey);

    boolean sendSubscribeMessage(String openid, String templateId, Map<String, Object> data, String page);

    boolean isWeChatServiceAvailable();

    Map<String, Object> getServiceStatus();
    
    /**
     * 处理微信消息
     * @param request HTTP请求
     * @param response HTTP响应
     */
    void handleMessage(HttpServletRequest request, HttpServletResponse response);
    
    /**
     * 获取微信访问令牌
     * @return 访问令牌信息
     */
    Map<String, Object> getAccessToken();
    
    /**
     * 验证微信签名
     * @param signature 签名
     * @param timestamp 时间戳
     * @param nonce 随机数
     * @return 验证结果
     */
    boolean verifySignature(String signature, String timestamp, String nonce);
    
    /**
     * 发送模板消息
     * @param messageData 消息数据
     * @return 发送结果
     */
    Map<String, Object> sendTemplateMessage(Map<String, Object> messageData);
    
    /**
     * 获取用户信息
     * @param openid 用户openid
     * @return 用户信息
     */
    Map<String, Object> getUserInfo(String openid);
}
